import request from '@/utils/request'

// 查询采购类项目需求申请列表
export function listDemand(params) {
  return request({
    url: '/archives/buyDemand/bsearch',
    method: 'get',
    params:params
  })
}

// 查询采购类项目需求申请详细
export function getDemand(buyDemandId) {
  return request({
    url: '/archives/buyDemand/blook/' + buyDemandId,
    method: 'get'
  })
}

// 新增采购类项目需求申请
export function addDemand(data) {
  return request({
    url: `/archives/buyDemand/badd`,
    method: 'post',
    data:data
  })
}

// 修改采购类项目需求申请
export function updateDemand(data) {
  return request({
    url: '/archives/buyDemand',
    method: 'put',
    data: data
  })
}

// 删除采购类项目需求申请
export function delDemand(buyDemandId) {
  return request({
    url: '/archives/buyDemand/' + buyDemandId,
    method: 'delete'
  })
}

export function getStage(data){
  return request({
    url:"/archives/buyDetails/bstage",
    method:"post",
    data:data
  })
}

export function queryList(params){
  return request({
    url:"/archives/buyDemand/bsearch",
    params
  })
}

export function confirmProject(buyDemandId){
  return request({
    url:`/archives/buyDemand/confirm/${buyDemandId}`,
    method:"post",
  })
}

export function recallProject(buyDemandId){
  return request({
    url:`/archives/buyDemand/withdraw/${buyDemandId}`,
    method:"post"
  })
}